library(multiMiR)
## Welcome to multiMiR.
## 
## multiMiR database URL has been set to the 
## default value: http://multimir.org/
## 
## Database Version: 2.3.0  Updated: 2020-04-15
library(clusterProfiler)
## 
## clusterProfiler v4.12.2 Learn more at https://yulab-smu.top/contribution-knowledge-mining/
## 
## Please cite:
## 
## T Wu, E Hu, S Xu, M Chen, P Guo, Z Dai, T Feng, L Zhou, W Tang, L Zhan,
## X Fu, S Liu, X Bo, and G Yu. clusterProfiler 4.0: A universal
## enrichment tool for interpreting omics data. The Innovation. 2021,
## 2(3):100141
## 
## Attaching package: 'clusterProfiler'
## The following object is masked from 'package:multiMiR':
## 
##     select
## The following object is masked from 'package:stats':
## 
##     filter
library(org.Hs.eg.db)
## Loading required package: AnnotationDbi
## Loading required package: stats4
## Loading required package: BiocGenerics
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, aperm, append, as.data.frame, basename, cbind,
##     colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
##     get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
##     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
##     Position, rank, rbind, Reduce, rownames, sapply, setdiff, table,
##     tapply, union, unique, unsplit, which.max, which.min
## Loading required package: Biobase
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
## Loading required package: IRanges
## Loading required package: S4Vectors
## 
## Attaching package: 'S4Vectors'
## The following object is masked from 'package:clusterProfiler':
## 
##     rename
## The following object is masked from 'package:utils':
## 
##     findMatches
## The following objects are masked from 'package:base':
## 
##     expand.grid, I, unname
## 
## Attaching package: 'IRanges'
## The following object is masked from 'package:clusterProfiler':
## 
##     slice
## The following object is masked from 'package:grDevices':
## 
##     windows
## 
## Attaching package: 'AnnotationDbi'
## The following object is masked from 'package:clusterProfiler':
## 
##     select
## 
library(stringr)
library(ggplot2)

0. Loading of Results

A. List of all Gene names in the dataset

gene.names = readRDS("data/derived/unique_gene_names.rds")

B. Selected Features

results.superbiclust.fabia.mofa = readRDS("data/sel_features/results_superbiclust.fabia_mofa.rds")
sel.features = results.superbiclust.fabia.mofa$resNames
sel.features
## [[1]]
##  [1] "hsa-mir-1185-1" "hsa-mir-1197"   "hsa-mir-127"    "hsa-mir-134"   
##  [5] "hsa-mir-136"    "hsa-mir-154"    "hsa-mir-323"    "hsa-mir-323b"  
##  [9] "hsa-mir-329-1"  "hsa-mir-329-2"  "hsa-mir-369"    "hsa-mir-370"   
## [13] "hsa-mir-376a-1" "hsa-mir-376a-2" "hsa-mir-376b"   "hsa-mir-377"   
## [17] "hsa-mir-380"    "hsa-mir-382"    "hsa-mir-410"    "hsa-mir-432"   
## [21] "hsa-mir-487a"   "hsa-mir-487b"   "hsa-mir-496"    "hsa-mir-539"   
## [25] "hsa-mir-541"    "hsa-mir-654"    "hsa-mir-655"    "hsa-mir-656"   
## [29] "hsa-mir-665"    "hsa-mir-668"    "hsa-mir-770"    "hsa-mir-889"   
## 
## [[2]]
##  [1] "hsa-mir-1185-1" "hsa-mir-1185-2" "hsa-mir-124-3"  "hsa-mir-135b"  
##  [5] "hsa-mir-206"    "hsa-mir-2114"   "hsa-mir-3166"   "hsa-mir-3199-1"
##  [9] "hsa-mir-3655"   "hsa-mir-3923"   "hsa-mir-3926-2" "hsa-mir-411"   
## [13] "hsa-mir-485"    "hsa-mir-487a"   "hsa-mir-494"    "hsa-mir-506"   
## [17] "hsa-mir-507"    "hsa-mir-508"    "hsa-mir-509-1"  "hsa-mir-509-2" 
## [21] "hsa-mir-509-3"  "hsa-mir-510"    "hsa-mir-513a-1" "hsa-mir-513a-2"
## [25] "hsa-mir-513b"   "hsa-mir-513c"   "hsa-mir-514-1"  "hsa-mir-514-2" 
## [29] "hsa-mir-514-3"  "hsa-mir-514b"   "hsa-mir-543"    "hsa-mir-582"   
## 
## [[3]]
##  [1] "TGM2.R2Gn"      "hsa-mir-1185-1" "hsa-mir-329-1"  "hsa-mir-329-2" 
##  [5] "hsa-mir-506"    "hsa-mir-507"    "hsa-mir-508"    "hsa-mir-510"   
##  [9] "hsa-mir-513a-1" "hsa-mir-513a-2" "hsa-mir-513c"   "hsa-mir-514b"  
## [13] "hsa-mir-516b-1" "hsa-mir-517a"   "hsa-mir-518b"   "hsa-mir-656"   
## 
## [[4]]
## [1] "FASN.RPPA"    "hsa-mir-3934" "hsa-mir-466"  "hsa-mir-510"  "hsa-mir-605" 
## 
## [[5]]
## character(0)
## 
## [[6]]
## [1] "G6PD.RPPA"
## 
## [[7]]
##  [1] "G6PD.RPPA"   "IGFBP2.RPPA" "RBM15.RPPA"  "GATA3.RPPA"  "PEA15.RPPA" 
##  [6] "ATM.RPPA"    "INPP4B.RPPA" "ACVRL1.RPPA" "TSC1.RPPA"   "CDK1.RPPA"  
## [11] "VHL.RPPA"    "PRDX1.RPPA"  "XBP1.RPPA"   "TFRC.RPPA"   "PREX1.RPPA" 
## 
## [[8]]
## [1] "RBM15.RPPA" "EGFR.RPPA"  "GAPDH.RPPA"
## 
## [[9]]
## [1] "ANLN.R2Gn"  "STMN1.R2Gn" "CDK1.R2Gn"  "CCNB1.R2Gn" "FOXM1.R2Gn"
## 
## [[10]]
## character(0)
## 
## [[11]]
## character(0)
## 
## [[12]]
## character(0)

1. Convert microRNA to genes

Also remove the ending “.R2Gn” and “.RPPA” from gene names.

split.by.omic = function(variable.list) {
  out.mRSG = variable.list[startsWith(variable.list, "hsa")]
  out.R2Gn = variable.list[endsWith(variable.list, ".R2Gn")]
  out.RPPA = variable.list[endsWith(variable.list, ".RPPA")]
  out = list("miRNASeqGene" = out.mRSG,
             "RNASeq2GeneNorm" = out.R2Gn,
             "RPPAArray" = out.RPPA)
  out
}
multiomics.to.GENES = function(sel.features, full.search = F, table = "validated", drop.miRNA = F) {
  multiomics.list = split.by.omic(sel.features)
  # Convert miRNASeqGene to target GENE names
  # Skipped and returns an empty list instead of the list of select features,
  # or if microRNA features are explicitly dropped (drop.miRNA = T).
  # (Usually done when the features has only a few miRNA and unable to target any genes)
  if (length(multiomics.list[[1]]) > 0 & !drop.miRNA) {
    if (!full.search) { # Search only among the 198 genes in ACC, recommended
    targets= get_multimir(mirna = multiomics.list[[1]], 
                          target = gene.names,
                          table = table,
                          summary = T)
    mRSG.target.genes = unique(targets@data$target_symbol)
    } else { # Search the full dataset, not recommended. 
             # Use only if ACC gene search returns nothing or fails.
             # Genes not in the ACC genes need to be manually removed.
    targets= get_multimir(mirna = multiomics.list[[1]], 
                          table = table,
                          summary = T)  
    mRSG.target.genes = unique(targets@data$target_symbol)
    }
    
  } else {
    mRSG.target.genes = list()
  }
  #Remove suffix for Pathway Analysis Compatibility
  R2Gn.genes = str_remove(multiomics.list[[2]], ".R2Gn")
  
  RPPA.genes = str_remove(multiomics.list[[3]], ".RPPA")
  
  #Join all cleaned-up genes are remove duplicates.
  out1 = c(mRSG.target.genes, R2Gn.genes, RPPA.genes)
  out = as.character(unique(out1))
  out
}
geneNames <- list("biclust1"=multiomics.to.GENES(sel.features[[1]]),
                  "biclust2"=multiomics.to.GENES(sel.features[[2]]),
                  "biclust3"=multiomics.to.GENES(sel.features[[3]]),
                  "biclust4"=multiomics.to.GENES(sel.features[[4]]),
                  "biclust6"=multiomics.to.GENES(sel.features[[6]]),
                  "biclust7"=multiomics.to.GENES(sel.features[[7]]),
                  "biclust8"=multiomics.to.GENES(sel.features[[8]]), 
                  "biclust9"=multiomics.to.GENES(sel.features[[9]]))
## Searching mirecords ...
## Searching mirtarbase ...
## Searching tarbase ...
## Searching mirecords ...
## Searching mirtarbase ...
## Searching tarbase ...
## Searching mirecords ...
## Searching mirtarbase ...
## Searching tarbase ...
## Searching mirecords ...
## Searching mirtarbase ...
## Searching tarbase ...
geneNames
## $biclust1
##  [1] "HSPA1A" "AKT1"   "VHL"    "MTOR"   "MAPK8"  "MYH9"   "CDKN1A" "FOXO3" 
##  [9] "ATM"    "CASP8"  "MACC1"  "STAT5A" "CCND1"  "YAP1"   "MAPK1"  "ANLN"  
## 
## $biclust2
##  [1] "ESR1"   "MET"    "G6PD"   "BCL2"   "KRAS"   "CCND1"  "NOTCH3" "AKT1"  
##  [9] "IGF1R"  "ETS1"   "XIAP"   "MAPK8"  "ARID1A" "BID"    "PTEN"   "NRAS"  
## [17] "PTK2"   "ATM"    "YWHAZ"  "FOXO3"  "CHEK1"  "FN1"    "NCOA3"  "GAB2"  
## [25] "ITGA2" 
## 
## $biclust3
## [1] "ETS1"   "XIAP"   "MAPK8"  "ARID1A" "BID"    "NCOA3"  "GAB2"   "TGM2"  
## 
## $biclust4
## [1] "CCND1"  "PIK3R1" "XIAP"   "CHEK1"  "IGF1R"  "SRSF1"  "TUBA1B" "FASN"  
## 
## $biclust6
## [1] "G6PD"
## 
## $biclust7
##  [1] "G6PD"   "IGFBP2" "RBM15"  "GATA3"  "PEA15"  "ATM"    "INPP4B" "ACVRL1"
##  [9] "TSC1"   "CDK1"   "VHL"    "PRDX1"  "XBP1"   "TFRC"   "PREX1" 
## 
## $biclust8
## [1] "RBM15" "EGFR"  "GAPDH"
## 
## $biclust9
## [1] "ANLN"  "STMN1" "CDK1"  "CCNB1" "FOXM1"
saveRDS(geneNames, file = "data/sel_features/gene_converted/genes_superbiclust.fabia_mofa.rds")

2. Pathway Analysis

A. GO Classification

ggo_MF <- list()#functional profile of a geneset for Molecular Function
ggo_BP <- list()#functional profile of a geneset for Biological Process
ggo_CC <- list()#functional profile of a geneset for Cellular Component


for(z in 1:length(geneNames)){
  print(z)
  input <- geneNames[[z]]

  ggo_MF[[z]] <- groupGO(gene=input,
    OrgDb = org.Hs.eg.db,
    ont="MF",
    keyType="SYMBOL",
    readable=TRUE)
  
  ggo_BP[[z]] <- groupGO(gene=input,
    OrgDb = org.Hs.eg.db,
    ont="BP",
    keyType="SYMBOL",
    readable=TRUE)

  ggo_CC[[z]] <- groupGO(gene=input,
    OrgDb = org.Hs.eg.db,
    ont="CC",
    keyType="SYMBOL",
    readable=TRUE)    
}
## [1] 1
## [1] 2
## [1] 3
## [1] 4
## [1] 5
## [1] 6
## [1] 7
## [1] 8
for(z in 1:length(geneNames)) {
  print(head(ggo_MF[[z]]))
  print(head(ggo_BP[[z]]))
  print(head(ggo_CC[[z]]))
}
##                    ID                  Description Count GeneRatio
## GO:0003774 GO:0003774  cytoskeletal motor activity     1      1/16
## GO:0003824 GO:0003824           catalytic activity    10     10/16
## GO:0005198 GO:0005198 structural molecule activity     0      0/16
## GO:0005215 GO:0005215         transporter activity     0      0/16
## GO:0005488 GO:0005488                      binding    16     16/16
## GO:0009055 GO:0009055   electron transfer activity     0      0/16
##                                                                                               geneID
## GO:0003774                                                                                      MYH9
## GO:0003824                                   HSPA1A/AKT1/VHL/MTOR/MAPK8/CDKN1A/ATM/CASP8/CCND1/MAPK1
## GO:0005198                                                                                          
## GO:0005215                                                                                          
## GO:0005488 HSPA1A/AKT1/VHL/MTOR/MAPK8/MYH9/CDKN1A/FOXO3/ATM/CASP8/MACC1/STAT5A/CCND1/YAP1/MAPK1/ANLN
## GO:0009055                                                                                          
##                    ID           Description Count GeneRatio
## GO:0000003 GO:0000003          reproduction     6      6/16
## GO:0002376 GO:0002376 immune system process    10     10/16
## GO:0008152 GO:0008152     metabolic process    15     15/16
## GO:0009987 GO:0009987      cellular process    16     16/16
## GO:0016032 GO:0016032         viral process     2      2/16
## GO:0022414 GO:0022414  reproductive process     6      6/16
##                                                                                               geneID
## GO:0000003                                                            AKT1/MTOR/MYH9/FOXO3/ATM/CASP8
## GO:0002376                                  HSPA1A/AKT1/MTOR/MAPK8/MYH9/CDKN1A/FOXO3/ATM/CASP8/MAPK1
## GO:0008152      HSPA1A/AKT1/VHL/MTOR/MAPK8/MYH9/CDKN1A/FOXO3/ATM/CASP8/MACC1/STAT5A/CCND1/YAP1/MAPK1
## GO:0009987 HSPA1A/AKT1/VHL/MTOR/MAPK8/MYH9/CDKN1A/FOXO3/ATM/CASP8/MACC1/STAT5A/CCND1/YAP1/MAPK1/ANLN
## GO:0016032                                                                               HSPA1A/AKT1
## GO:0022414                                                            AKT1/MTOR/MYH9/FOXO3/ATM/CASP8
##                    ID                Description Count GeneRatio
## GO:0032991 GO:0032991 protein-containing complex    11     11/16
## GO:0044423 GO:0044423           virion component     0      0/16
## GO:0110165 GO:0110165 cellular anatomical entity    16     16/16
##                                                                                               geneID
## GO:0032991                            HSPA1A/AKT1/MTOR/MYH9/CDKN1A/FOXO3/ATM/CASP8/STAT5A/CCND1/YAP1
## GO:0044423                                                                                          
## GO:0110165 HSPA1A/AKT1/VHL/MTOR/MAPK8/MYH9/CDKN1A/FOXO3/ATM/CASP8/MACC1/STAT5A/CCND1/YAP1/MAPK1/ANLN
##                    ID                  Description Count GeneRatio
## GO:0003774 GO:0003774  cytoskeletal motor activity     0      0/25
## GO:0003824 GO:0003824           catalytic activity    14     14/25
## GO:0005198 GO:0005198 structural molecule activity     1      1/25
## GO:0005215 GO:0005215         transporter activity     2      2/25
## GO:0005488 GO:0005488                      binding    25     25/25
## GO:0009055 GO:0009055   electron transfer activity     0      0/25
##                                                                                                                                          geneID
## GO:0003774                                                                                                                                     
## GO:0003824                                                             MET/G6PD/KRAS/CCND1/AKT1/IGF1R/XIAP/MAPK8/PTEN/NRAS/PTK2/ATM/CHEK1/NCOA3
## GO:0005198                                                                                                                                  FN1
## GO:0005215                                                                                                                           BCL2/IGF1R
## GO:0005488 ESR1/MET/G6PD/BCL2/KRAS/CCND1/NOTCH3/AKT1/IGF1R/ETS1/XIAP/MAPK8/ARID1A/BID/PTEN/NRAS/PTK2/ATM/YWHAZ/FOXO3/CHEK1/FN1/NCOA3/GAB2/ITGA2
## GO:0009055                                                                                                                                     
##                    ID           Description Count GeneRatio
## GO:0000003 GO:0000003          reproduction     8      8/25
## GO:0002376 GO:0002376 immune system process    17     17/25
## GO:0008152 GO:0008152     metabolic process    23     23/25
## GO:0009987 GO:0009987      cellular process    25     25/25
## GO:0016032 GO:0016032         viral process     3      3/25
## GO:0022414 GO:0022414  reproductive process     8      8/25
##                                                                                                                                          geneID
## GO:0000003                                                                                            ESR1/BCL2/AKT1/IGF1R/PTEN/ATM/FOXO3/ITGA2
## GO:0002376                                             ESR1/G6PD/BCL2/AKT1/IGF1R/ETS1/XIAP/MAPK8/ARID1A/BID/PTK2/ATM/YWHAZ/FOXO3/FN1/GAB2/ITGA2
## GO:0008152           ESR1/MET/G6PD/BCL2/KRAS/CCND1/NOTCH3/AKT1/IGF1R/ETS1/XIAP/MAPK8/ARID1A/BID/PTEN/PTK2/ATM/YWHAZ/FOXO3/CHEK1/FN1/NCOA3/ITGA2
## GO:0009987 ESR1/MET/G6PD/BCL2/KRAS/CCND1/NOTCH3/AKT1/IGF1R/ETS1/XIAP/MAPK8/ARID1A/BID/PTEN/NRAS/PTK2/ATM/YWHAZ/FOXO3/CHEK1/FN1/NCOA3/GAB2/ITGA2
## GO:0016032                                                                                                                      BCL2/AKT1/ITGA2
## GO:0022414                                                                                            ESR1/BCL2/AKT1/IGF1R/PTEN/ATM/FOXO3/ITGA2
##                    ID                Description Count GeneRatio
## GO:0032991 GO:0032991 protein-containing complex    15     15/25
## GO:0044423 GO:0044423           virion component     0      0/25
## GO:0110165 GO:0110165 cellular anatomical entity    25     25/25
##                                                                                                                                          geneID
## GO:0032991                                                    ESR1/MET/BCL2/CCND1/NOTCH3/AKT1/IGF1R/ETS1/ARID1A/ATM/FOXO3/CHEK1/FN1/NCOA3/ITGA2
## GO:0044423                                                                                                                                     
## GO:0110165 ESR1/MET/G6PD/BCL2/KRAS/CCND1/NOTCH3/AKT1/IGF1R/ETS1/XIAP/MAPK8/ARID1A/BID/PTEN/NRAS/PTK2/ATM/YWHAZ/FOXO3/CHEK1/FN1/NCOA3/GAB2/ITGA2
##                    ID                  Description Count GeneRatio
## GO:0003774 GO:0003774  cytoskeletal motor activity     0       0/8
## GO:0003824 GO:0003824           catalytic activity     4       4/8
## GO:0005198 GO:0005198 structural molecule activity     0       0/8
## GO:0005215 GO:0005215         transporter activity     0       0/8
## GO:0005488 GO:0005488                      binding     8       8/8
## GO:0009055 GO:0009055   electron transfer activity     0       0/8
##                                                geneID
## GO:0003774                                           
## GO:0003824                      XIAP/MAPK8/NCOA3/TGM2
## GO:0005198                                           
## GO:0005215                                           
## GO:0005488 ETS1/XIAP/MAPK8/ARID1A/BID/NCOA3/GAB2/TGM2
## GO:0009055                                           
##                    ID           Description Count GeneRatio
## GO:0000003 GO:0000003          reproduction     0       0/8
## GO:0002376 GO:0002376 immune system process     6       6/8
## GO:0008152 GO:0008152     metabolic process     7       7/8
## GO:0009987 GO:0009987      cellular process     8       8/8
## GO:0016032 GO:0016032         viral process     0       0/8
## GO:0022414 GO:0022414  reproductive process     0       0/8
##                                                geneID
## GO:0000003                                           
## GO:0002376            ETS1/XIAP/MAPK8/ARID1A/BID/GAB2
## GO:0008152      ETS1/XIAP/MAPK8/ARID1A/BID/NCOA3/TGM2
## GO:0009987 ETS1/XIAP/MAPK8/ARID1A/BID/NCOA3/GAB2/TGM2
## GO:0016032                                           
## GO:0022414                                           
##                    ID                Description Count GeneRatio
## GO:0032991 GO:0032991 protein-containing complex     4       4/8
## GO:0044423 GO:0044423           virion component     0       0/8
## GO:0110165 GO:0110165 cellular anatomical entity     8       8/8
##                                                geneID
## GO:0032991                     ETS1/ARID1A/NCOA3/TGM2
## GO:0044423                                           
## GO:0110165 ETS1/XIAP/MAPK8/ARID1A/BID/NCOA3/GAB2/TGM2
##                    ID                  Description Count GeneRatio
## GO:0003774 GO:0003774  cytoskeletal motor activity     0       0/8
## GO:0003824 GO:0003824           catalytic activity     7       7/8
## GO:0005198 GO:0005198 structural molecule activity     1       1/8
## GO:0005215 GO:0005215         transporter activity     1       1/8
## GO:0005488 GO:0005488                      binding     8       8/8
## GO:0009055 GO:0009055   electron transfer activity     0       0/8
##                                                     geneID
## GO:0003774                                                
## GO:0003824       CCND1/PIK3R1/XIAP/CHEK1/IGF1R/TUBA1B/FASN
## GO:0005198                                          TUBA1B
## GO:0005215                                           IGF1R
## GO:0005488 CCND1/PIK3R1/XIAP/CHEK1/IGF1R/SRSF1/TUBA1B/FASN
## GO:0009055                                                
##                    ID           Description Count GeneRatio
## GO:0000003 GO:0000003          reproduction     1       1/8
## GO:0002376 GO:0002376 immune system process     3       3/8
## GO:0008152 GO:0008152     metabolic process     7       7/8
## GO:0009987 GO:0009987      cellular process     8       8/8
## GO:0016032 GO:0016032         viral process     0       0/8
## GO:0022414 GO:0022414  reproductive process     1       1/8
##                                                     geneID
## GO:0000003                                           IGF1R
## GO:0002376                               PIK3R1/XIAP/IGF1R
## GO:0008152        CCND1/PIK3R1/XIAP/CHEK1/IGF1R/SRSF1/FASN
## GO:0009987 CCND1/PIK3R1/XIAP/CHEK1/IGF1R/SRSF1/TUBA1B/FASN
## GO:0016032                                                
## GO:0022414                                           IGF1R
##                    ID                Description Count GeneRatio
## GO:0032991 GO:0032991 protein-containing complex     5       5/8
## GO:0044423 GO:0044423           virion component     0       0/8
## GO:0110165 GO:0110165 cellular anatomical entity     8       8/8
##                                                     geneID
## GO:0032991                  CCND1/PIK3R1/CHEK1/IGF1R/SRSF1
## GO:0044423                                                
## GO:0110165 CCND1/PIK3R1/XIAP/CHEK1/IGF1R/SRSF1/TUBA1B/FASN
##                    ID                  Description Count GeneRatio geneID
## GO:0003774 GO:0003774  cytoskeletal motor activity     0       0/1       
## GO:0003824 GO:0003824           catalytic activity     1       1/1   G6PD
## GO:0005198 GO:0005198 structural molecule activity     0       0/1       
## GO:0005215 GO:0005215         transporter activity     0       0/1       
## GO:0005488 GO:0005488                      binding     1       1/1   G6PD
## GO:0009055 GO:0009055   electron transfer activity     0       0/1       
##                    ID           Description Count GeneRatio geneID
## GO:0000003 GO:0000003          reproduction     0       0/1       
## GO:0002376 GO:0002376 immune system process     1       1/1   G6PD
## GO:0008152 GO:0008152     metabolic process     1       1/1   G6PD
## GO:0009987 GO:0009987      cellular process     1       1/1   G6PD
## GO:0016032 GO:0016032         viral process     0       0/1       
## GO:0022414 GO:0022414  reproductive process     0       0/1       
##                    ID                Description Count GeneRatio geneID
## GO:0032991 GO:0032991 protein-containing complex     0       0/1       
## GO:0044423 GO:0044423           virion component     0       0/1       
## GO:0110165 GO:0110165 cellular anatomical entity     1       1/1   G6PD
##                    ID                  Description Count GeneRatio
## GO:0003774 GO:0003774  cytoskeletal motor activity     0      0/15
## GO:0003824 GO:0003824           catalytic activity     7      7/15
## GO:0005198 GO:0005198 structural molecule activity     0      0/15
## GO:0005215 GO:0005215         transporter activity     0      0/15
## GO:0005488 GO:0005488                      binding    15     15/15
## GO:0009055 GO:0009055   electron transfer activity     0      0/15
##                                                                                         geneID
## GO:0003774                                                                                    
## GO:0003824                                               G6PD/ATM/INPP4B/ACVRL1/CDK1/VHL/PRDX1
## GO:0005198                                                                                    
## GO:0005215                                                                                    
## GO:0005488 G6PD/IGFBP2/RBM15/GATA3/PEA15/ATM/INPP4B/ACVRL1/TSC1/CDK1/VHL/PRDX1/XBP1/TFRC/PREX1
## GO:0009055                                                                                    
##                    ID           Description Count GeneRatio
## GO:0000003 GO:0000003          reproduction     4      4/15
## GO:0002376 GO:0002376 immune system process    10     10/15
## GO:0008152 GO:0008152     metabolic process    13     13/15
## GO:0009987 GO:0009987      cellular process    15     15/15
## GO:0016032 GO:0016032         viral process     2      2/15
## GO:0022414 GO:0022414  reproductive process     4      4/15
##                                                                                         geneID
## GO:0000003                                                               IGFBP2/GATA3/ATM/CDK1
## GO:0002376                              G6PD/IGFBP2/RBM15/GATA3/ATM/TSC1/PRDX1/XBP1/TFRC/PREX1
## GO:0008152              G6PD/RBM15/GATA3/ATM/INPP4B/ACVRL1/TSC1/CDK1/VHL/PRDX1/XBP1/TFRC/PREX1
## GO:0009987 G6PD/IGFBP2/RBM15/GATA3/PEA15/ATM/INPP4B/ACVRL1/TSC1/CDK1/VHL/PRDX1/XBP1/TFRC/PREX1
## GO:0016032                                                                           CDK1/TFRC
## GO:0022414                                                               IGFBP2/GATA3/ATM/CDK1
##                    ID                Description Count GeneRatio
## GO:0032991 GO:0032991 protein-containing complex     9      9/15
## GO:0044423 GO:0044423           virion component     0      0/15
## GO:0110165 GO:0110165 cellular anatomical entity    15     15/15
##                                                                                         geneID
## GO:0032991                                    RBM15/GATA3/PEA15/ATM/ACVRL1/TSC1/CDK1/XBP1/TFRC
## GO:0044423                                                                                    
## GO:0110165 G6PD/IGFBP2/RBM15/GATA3/PEA15/ATM/INPP4B/ACVRL1/TSC1/CDK1/VHL/PRDX1/XBP1/TFRC/PREX1
##                    ID                  Description Count GeneRatio
## GO:0003774 GO:0003774  cytoskeletal motor activity     0       0/3
## GO:0003824 GO:0003824           catalytic activity     2       2/3
## GO:0005198 GO:0005198 structural molecule activity     0       0/3
## GO:0005215 GO:0005215         transporter activity     0       0/3
## GO:0005488 GO:0005488                      binding     3       3/3
## GO:0009055 GO:0009055   electron transfer activity     0       0/3
##                      geneID
## GO:0003774                 
## GO:0003824       EGFR/GAPDH
## GO:0005198                 
## GO:0005215                 
## GO:0005488 RBM15/EGFR/GAPDH
## GO:0009055                 
##                    ID           Description Count GeneRatio           geneID
## GO:0000003 GO:0000003          reproduction     1       1/3             EGFR
## GO:0002376 GO:0002376 immune system process     2       2/3      RBM15/GAPDH
## GO:0008152 GO:0008152     metabolic process     3       3/3 RBM15/EGFR/GAPDH
## GO:0009987 GO:0009987      cellular process     3       3/3 RBM15/EGFR/GAPDH
## GO:0016032 GO:0016032         viral process     1       1/3             EGFR
## GO:0022414 GO:0022414  reproductive process     1       1/3             EGFR
##                    ID                Description Count GeneRatio
## GO:0032991 GO:0032991 protein-containing complex     3       3/3
## GO:0044423 GO:0044423           virion component     0       0/3
## GO:0110165 GO:0110165 cellular anatomical entity     3       3/3
##                      geneID
## GO:0032991 RBM15/EGFR/GAPDH
## GO:0044423                 
## GO:0110165 RBM15/EGFR/GAPDH
##                    ID                  Description Count GeneRatio
## GO:0003774 GO:0003774  cytoskeletal motor activity     0       0/5
## GO:0003824 GO:0003824           catalytic activity     1       1/5
## GO:0005198 GO:0005198 structural molecule activity     0       0/5
## GO:0005215 GO:0005215         transporter activity     0       0/5
## GO:0005488 GO:0005488                      binding     5       5/5
## GO:0009055 GO:0009055   electron transfer activity     0       0/5
##                                 geneID
## GO:0003774                            
## GO:0003824                        CDK1
## GO:0005198                            
## GO:0005215                            
## GO:0005488 ANLN/STMN1/CDK1/CCNB1/FOXM1
## GO:0009055                            
##                    ID           Description Count GeneRatio
## GO:0000003 GO:0000003          reproduction     1       1/5
## GO:0002376 GO:0002376 immune system process     0       0/5
## GO:0008152 GO:0008152     metabolic process     3       3/5
## GO:0009987 GO:0009987      cellular process     5       5/5
## GO:0016032 GO:0016032         viral process     1       1/5
## GO:0022414 GO:0022414  reproductive process     1       1/5
##                                 geneID
## GO:0000003                        CDK1
## GO:0002376                            
## GO:0008152            CDK1/CCNB1/FOXM1
## GO:0009987 ANLN/STMN1/CDK1/CCNB1/FOXM1
## GO:0016032                        CDK1
## GO:0022414                        CDK1
##                    ID                Description Count GeneRatio
## GO:0032991 GO:0032991 protein-containing complex     3       3/5
## GO:0044423 GO:0044423           virion component     0       0/5
## GO:0110165 GO:0110165 cellular anatomical entity     5       5/5
##                                 geneID
## GO:0032991            CDK1/CCNB1/FOXM1
## GO:0044423                            
## GO:0110165 ANLN/STMN1/CDK1/CCNB1/FOXM1
barplot(ggo_MF[[1]], title = "groupGO, Molecular Function, bicluster 1")

barplot(ggo_MF[[2]], title = "groupGO, Molecular Function, bicluster 2")

barplot(ggo_MF[[3]], title = "groupGO, Molecular Function, bicluster 3")

barplot(ggo_MF[[4]], title = "groupGO, Molecular Function, bicluster 4")

barplot(ggo_MF[[5]], title = "groupGO, Molecular Function, bicluster 6")

barplot(ggo_MF[[6]], title = "groupGO, Molecular Function, bicluster 7")

barplot(ggo_MF[[7]], title = "groupGO, Molecular Function, bicluster 8")

barplot(ggo_MF[[8]], title = "groupGO, Molecular Function, bicluster 9")

barplot(ggo_BP[[1]], title = "groupGO, Biological Process, bicluster 1")

barplot(ggo_BP[[2]], title = "groupGO, Biological Process, bicluster 2")

barplot(ggo_BP[[3]], title = "groupGO, Biological Process, bicluster 3")

barplot(ggo_BP[[4]], title = "groupGO, Biological Process, bicluster 4")

barplot(ggo_BP[[5]], title = "groupGO, Biological Process, bicluster 6")

barplot(ggo_BP[[6]], title = "groupGO, Biological Process, bicluster 7")

barplot(ggo_BP[[7]], title = "groupGO, Biological Process, bicluster 8")

barplot(ggo_BP[[8]], title = "groupGO, Biological Process, bicluster 9")

barplot(ggo_CC[[1]], title = "groupGO, Cellular Component, bicluster 1")

barplot(ggo_CC[[2]], title = "groupGO, Cellular Component, bicluster 2")

barplot(ggo_CC[[3]], title = "groupGO, Cellular Component, bicluster 3")

barplot(ggo_CC[[4]], title = "groupGO, Cellular Component, bicluster 4")

barplot(ggo_CC[[5]], title = "groupGO, Cellular Component, bicluster 6")

barplot(ggo_CC[[6]], title = "groupGO, Cellular Component, bicluster 7")

barplot(ggo_CC[[7]], title = "groupGO, Cellular Component, bicluster 8")

barplot(ggo_CC[[8]], title = "groupGO, Cellular Component, bicluster 9")

B. GO Over-Representation

ego_MF <- list()#GO enrichment of a geneset for Molecular Function
ego_BP <- list()#GO enrichment of a geneset for Biological Process
ego_CC <- list()#GO enrichment of a geneset for Cellular Component


for(z in 1:length(geneNames)){
  print(z)
  input <- geneNames[[z]]
  ego_MF[[z]] <- enrichGO(
    gene          = input,
    OrgDb         = org.Hs.eg.db,
    ont           = "MF",
    pAdjustMethod = "BH",
    keyType="SYMBOL",
    pvalueCutoff  = 0.05,
    qvalueCutoff  = 0.05,
    minGSSize     = 2,
    readable      = TRUE)
  
  ego_BP[[z]] <- enrichGO(
    gene          = input,
    OrgDb         = org.Hs.eg.db,
    ont           = "BP",
    pAdjustMethod = "BH",
    keyType="SYMBOL",
    pvalueCutoff  = 0.05,
    qvalueCutoff  = 0.05,
    minGSSize     = 2,
    readable      = TRUE)
  
  ego_CC[[z]] <- enrichGO(
    gene          = input,
    OrgDb         = org.Hs.eg.db,
    ont           = "CC",
    pAdjustMethod = "BH",
    keyType="SYMBOL",
    pvalueCutoff  = 0.05,
    qvalueCutoff  = 0.05,
    minGSSize     = 2,
    readable      = TRUE)
}
## [1] 1
## [1] 2
## [1] 3
## [1] 4
## [1] 5
## [1] 6
## [1] 7
## [1] 8
for(z in 1:length(geneNames)){
  print(head(ego_MF[[z]]))
  print(head(ego_BP[[z]]))
  print(head(ego_CC[[z]]))
}
##                    ID                                        Description
## GO:0106310 GO:0106310                     protein serine kinase activity
## GO:0004674 GO:0004674           protein serine/threonine kinase activity
## GO:0004707 GO:0004707                                MAP kinase activity
## GO:0070064 GO:0070064                        proline-rich region binding
## GO:0042826 GO:0042826                        histone deacetylase binding
## GO:0030291 GO:0030291 protein serine/threonine kinase inhibitor activity
##            GeneRatio   BgRatio       pvalue    p.adjust       qvalue
## GO:0106310      5/16 363/18522 1.028418e-05 0.001244385 0.0004330180
## GO:0004674      5/16 427/18522 2.252414e-05 0.001362710 0.0004741923
## GO:0004707      2/16  16/18522 8.336346e-05 0.002856537 0.0009940104
## GO:0070064      2/16  17/18522 9.443099e-05 0.002856537 0.0009940104
## GO:0042826      3/16 128/18522 1.690349e-04 0.004090645 0.0014234520
## GO:0030291      2/16  37/18522 4.577980e-04 0.009232259 0.0032126172
##                               geneID Count
## GO:0106310 AKT1/MTOR/MAPK8/ATM/MAPK1     5
## GO:0004674 AKT1/MTOR/MAPK8/ATM/MAPK1     5
## GO:0004707               MAPK8/MAPK1     2
## GO:0070064                CCND1/YAP1     2
## GO:0042826        HSPA1A/MAPK8/CCND1     3
## GO:0030291               AKT1/CDKN1A     2
##                    ID                                  Description GeneRatio
## GO:0062197 GO:0062197         cellular response to chemical stress      7/16
## GO:0009408 GO:0009408                             response to heat      5/16
## GO:0034599 GO:0034599        cellular response to oxidative stress      6/16
## GO:0034198 GO:0034198   cellular response to amino acid starvation      4/16
## GO:1990928 GO:1990928            response to amino acid starvation      4/16
## GO:0034614 GO:0034614 cellular response to reactive oxygen species      5/16
##              BgRatio       pvalue     p.adjust       qvalue
## GO:0062197 311/18888 3.090160e-09 5.185288e-06 1.876866e-06
## GO:0009408 104/18888 1.911902e-08 1.604086e-05 5.806146e-06
## GO:0034599 248/18888 3.459920e-08 1.935249e-05 7.004821e-06
## GO:0034198  51/18888 8.376414e-08 3.337785e-05 1.208144e-05
## GO:1990928  54/18888 1.058426e-07 3.337785e-05 1.208144e-05
## GO:0034614 151/18888 1.243248e-07 3.337785e-05 1.208144e-05
##                                            geneID Count
## GO:0062197 HSPA1A/AKT1/MTOR/MAPK8/FOXO3/ATM/MAPK1     7
## GO:0009408            HSPA1A/AKT1/MTOR/CDKN1A/ATM     5
## GO:0034599      HSPA1A/AKT1/MAPK8/FOXO3/ATM/MAPK1     6
## GO:0034198                MTOR/MAPK8/CDKN1A/MAPK1     4
## GO:1990928                MTOR/MAPK8/CDKN1A/MAPK1     4
## GO:0034614             AKT1/MAPK8/FOXO3/ATM/MAPK1     5
##                    ID                                        Description
## GO:0005826 GO:0005826                        actomyosin contractile ring
## GO:0070938 GO:0070938                                   contractile ring
## GO:0005819 GO:0005819                                            spindle
## GO:0008180 GO:0008180                                   COP9 signalosome
## GO:0005741 GO:0005741                       mitochondrial outer membrane
## GO:0000307 GO:0000307 cyclin-dependent protein kinase holoenzyme complex
##            GeneRatio   BgRatio       pvalue     p.adjust       qvalue
## GO:0005826      2/16   4/19894 3.635235e-06 0.0003635235 0.0001913281
## GO:0070938      2/16  10/19894 2.718760e-05 0.0013593802 0.0007154633
## GO:0005819      4/16 433/19894 3.272457e-04 0.0094003057 0.0049475293
## GO:0008180      2/16  36/19894 3.760122e-04 0.0094003057 0.0049475293
## GO:0005741      3/16 219/19894 6.628567e-04 0.0121604395 0.0064002313
## GO:0000307      2/16  56/19894 9.105620e-04 0.0121604395 0.0064002313
##                         geneID Count
## GO:0005826           MYH9/ANLN     2
## GO:0070938           MYH9/ANLN     2
## GO:0005819 AKT1/MYH9/ATM/MAPK1     4
## GO:0008180         HSPA1A/MYH9     2
## GO:0005741    MTOR/FOXO3/CASP8     3
## GO:0000307        CDKN1A/CCND1     2
##                    ID                              Description GeneRatio
## GO:0140297 GO:0140297 DNA-binding transcription factor binding      6/25
## GO:0030235 GO:0030235 nitric-oxide synthase regulator activity      2/25
## GO:0120283 GO:0120283  protein serine/threonine kinase binding      2/25
## GO:0019903 GO:0019903              protein phosphatase binding      4/25
## GO:0019902 GO:0019902                      phosphatase binding      4/25
## GO:0035173 GO:0035173                  histone kinase activity      2/25
##              BgRatio       pvalue    p.adjust       qvalue
## GO:0140297 478/18522 3.340010e-05 0.001894097 0.0008850464
## GO:0030235   7/18522 3.657799e-05 0.001894097 0.0008850464
## GO:0120283   7/18522 3.657799e-05 0.001894097 0.0008850464
## GO:0019903 142/18522 3.695798e-05 0.001894097 0.0008850464
## GO:0019902 189/18522 1.123278e-04 0.004605439 0.0021519640
## GO:0035173  23/18522 4.348808e-04 0.013856762 0.0064747897
##                                       geneID Count
## GO:0140297 ESR1/BCL2/ETS1/ARID1A/YWHAZ/NCOA3     6
## GO:0030235                         ESR1/AKT1     2
## GO:0120283                        XIAP/MAPK8     2
## GO:0019903               MET/BCL2/MAPK8/PTK2     4
## GO:0019902               MET/BCL2/MAPK8/PTK2     4
## GO:0035173                         ATM/CHEK1     2
##                    ID                                         Description
## GO:0051402 GO:0051402                            neuron apoptotic process
## GO:2000045 GO:2000045 regulation of G1/S transition of mitotic cell cycle
## GO:1902806 GO:1902806      regulation of cell cycle G1/S phase transition
## GO:1901990 GO:1901990   regulation of mitotic cell cycle phase transition
## GO:0000082 GO:0000082               G1/S transition of mitotic cell cycle
## GO:0044843 GO:0044843                    cell cycle G1/S phase transition
##            GeneRatio   BgRatio       pvalue     p.adjust       qvalue
## GO:0051402      8/25 292/18888 2.552612e-09 3.162876e-06 1.382880e-06
## GO:2000045      7/25 185/18888 3.196439e-09 3.162876e-06 1.382880e-06
## GO:1902806      7/25 211/18888 7.964698e-09 5.254046e-06 2.297187e-06
## GO:1901990      8/25 356/18888 1.203946e-08 5.956522e-06 2.604325e-06
## GO:0000082      7/25 234/18888 1.627946e-08 6.443412e-06 2.817204e-06
## GO:0044843      7/25 262/18888 3.541992e-08 1.168267e-05 5.107926e-06
##                                               geneID Count
## GO:0051402   G6PD/BCL2/KRAS/CCND1/XIAP/BID/ATM/FOXO3     8
## GO:2000045       BCL2/CCND1/AKT1/ARID1A/BID/PTEN/ATM     7
## GO:1902806       BCL2/CCND1/AKT1/ARID1A/BID/PTEN/ATM     7
## GO:1901990 BCL2/CCND1/AKT1/ARID1A/BID/PTEN/ATM/CHEK1     8
## GO:0000082       BCL2/CCND1/AKT1/ARID1A/BID/PTEN/ATM     7
## GO:0044843       BCL2/CCND1/AKT1/ARID1A/BID/PTEN/ATM     7
##                    ID                         Description GeneRatio   BgRatio
## GO:0005741 GO:0005741        mitochondrial outer membrane      4/25 219/19894
## GO:0031968 GO:0031968            organelle outer membrane      4/25 248/19894
## GO:0019867 GO:0019867                      outer membrane      4/25 250/19894
## GO:0009898 GO:0009898 cytoplasmic side of plasma membrane      3/25 161/19894
## GO:0043209 GO:0043209                       myelin sheath      2/25  46/19894
## GO:0005925 GO:0005925                      focal adhesion      4/25 421/19894
##                  pvalue    p.adjust      qvalue                geneID Count
## GO:0005741 0.0001507289 0.008506653 0.005794005   BCL2/KRAS/BID/FOXO3     4
## GO:0031968 0.0002426479 0.008506653 0.005794005   BCL2/KRAS/BID/FOXO3     4
## GO:0019867 0.0002501957 0.008506653 0.005794005   BCL2/KRAS/BID/FOXO3     4
## GO:0009898 0.0010497787 0.024580717 0.016742284        G6PD/KRAS/PTEN     3
## GO:0043209 0.0015168846 0.024580717 0.016742284             BCL2/PTEN     2
## GO:0005925 0.0017581642 0.024580717 0.016742284 KRAS/PTK2/YWHAZ/ITGA2     4
##                    ID
## GO:0120283 GO:0120283
## GO:0003713 GO:0003713
## GO:0030374 GO:0030374
## GO:0061629 GO:0061629
## GO:0016410 GO:0016410
## GO:0140297 GO:0140297
##                                                                    Description
## GO:0120283                             protein serine/threonine kinase binding
## GO:0003713                                  transcription coactivator activity
## GO:0030374                               nuclear receptor coactivator activity
## GO:0061629 RNA polymerase II-specific DNA-binding transcription factor binding
## GO:0016410                                          N-acyltransferase activity
## GO:0140297                            DNA-binding transcription factor binding
##            GeneRatio   BgRatio       pvalue    p.adjust       qvalue
## GO:0120283       2/8   7/18522 3.424411e-06 0.000232860 9.732538e-05
## GO:0003713       3/8 271/18522 1.642917e-04 0.005432205 2.270426e-03
## GO:0030374       2/8  55/18522 2.396561e-04 0.005432205 2.270426e-03
## GO:0061629       3/8 343/18522 3.290146e-04 0.005593248 2.337735e-03
## GO:0016410       2/8  95/18522 7.143770e-04 0.009715527 4.060669e-03
## GO:0140297       3/8 478/18522 8.683135e-04 0.009840887 4.113064e-03
##                       geneID Count
## GO:0120283        XIAP/MAPK8     2
## GO:0003713 ETS1/ARID1A/NCOA3     3
## GO:0030374        ETS1/NCOA3     2
## GO:0061629 ETS1/ARID1A/NCOA3     3
## GO:0016410        NCOA3/TGM2     2
## GO:0140297 ETS1/ARID1A/NCOA3     3
##                    ID                                              Description
## GO:1902459 GO:1902459  positive regulation of stem cell population maintenance
## GO:0030522 GO:0030522                 intracellular receptor signaling pathway
## GO:2000036 GO:2000036           regulation of stem cell population maintenance
## GO:0018277 GO:0018277                                      protein deamination
## GO:1902528 GO:1902528          regulation of protein linear polyubiquitination
## GO:1902530 GO:1902530 positive regulation of protein linear polyubiquitination
##            GeneRatio   BgRatio       pvalue   p.adjust     qvalue
## GO:1902459       2/8  48/18888 0.0001753538 0.04414629 0.02178271
## GO:0030522       3/8 369/18888 0.0003850393 0.04414629 0.02178271
## GO:2000036       2/8  73/18888 0.0004063778 0.04414629 0.02178271
## GO:0018277       1/8   2/18888 0.0008469417 0.04414629 0.02178271
## GO:1902528       1/8   2/18888 0.0008469417 0.04414629 0.02178271
## GO:1902530       1/8   2/18888 0.0008469417 0.04414629 0.02178271
##                       geneID Count
## GO:1902459      ARID1A/NCOA3     2
## GO:0030522 XIAP/MAPK8/ARID1A     3
## GO:2000036      ARID1A/NCOA3     2
## GO:0018277              TGM2     1
## GO:1902528              XIAP     1
## GO:1902530              XIAP     1
##                    ID     Description GeneRatio  BgRatio      pvalue   p.adjust
## GO:0097441 GO:0097441  basal dendrite       1/8  6/19894 0.002410666 0.02181829
## GO:0140092 GO:0140092    bBAF complex       1/8 10/19894 0.004014950 0.02181829
## GO:0035060 GO:0035060  brahma complex       1/8 14/19894 0.005616977 0.02181829
## GO:0071564 GO:0071564   npBAF complex       1/8 14/19894 0.005616977 0.02181829
## GO:0071565 GO:0071565    nBAF complex       1/8 16/19894 0.006417144 0.02181829
## GO:0016514 GO:0016514 SWI/SNF complex       1/8 30/19894 0.012002558 0.03400725
##                qvalue geneID Count
## GO:0097441 0.01350978  MAPK8     1
## GO:0140092 0.01350978 ARID1A     1
## GO:0035060 0.01350978 ARID1A     1
## GO:0071564 0.01350978 ARID1A     1
## GO:0071565 0.01350978 ARID1A     1
## GO:0016514 0.02105712 ARID1A     1
##                    ID                           Description GeneRatio   BgRatio
## GO:0043559 GO:0043559                       insulin binding       2/8   5/18522
## GO:0043560 GO:0043560    insulin receptor substrate binding       2/8  13/18522
## GO:0005158 GO:0005158              insulin receptor binding       2/8  22/18522
## GO:0043548 GO:0043548 phosphatidylinositol 3-kinase binding       2/8  25/18522
## GO:0017046 GO:0017046               peptide hormone binding       2/8  50/18522
## GO:0033218 GO:0033218                         amide binding       3/8 409/18522
##                  pvalue     p.adjust       qvalue            geneID Count
## GO:0043559 1.631377e-06 0.0001761887 6.182059e-05      PIK3R1/IGF1R     2
## GO:0043560 1.270277e-05 0.0006859494 2.406840e-04      PIK3R1/IGF1R     2
## GO:0005158 3.754665e-05 0.0013157179 4.616554e-04      PIK3R1/IGF1R     2
## GO:0043548 4.873029e-05 0.0013157179 4.616554e-04      PIK3R1/IGF1R     2
## GO:0017046 1.979099e-04 0.0042748535 1.499949e-03      PIK3R1/IGF1R     2
## GO:0033218 5.511240e-04 0.0049093069 1.722564e-03 PIK3R1/IGF1R/FASN     3
##                    ID                                           Description
## GO:0031099 GO:0031099                                          regeneration
## GO:0097421 GO:0097421                                    liver regeneration
## GO:0071353 GO:0071353                    cellular response to interleukin-4
## GO:0070670 GO:0070670                             response to interleukin-4
## GO:0033120 GO:0033120                   positive regulation of RNA splicing
## GO:0048009 GO:0048009 insulin-like growth factor receptor signaling pathway
##            GeneRatio   BgRatio       pvalue   p.adjust      qvalue
## GO:0031099       3/8 200/18888 6.298081e-05 0.01533276 0.006745377
## GO:0097421       2/8  30/18888 6.788160e-05 0.01533276 0.006745377
## GO:0071353       2/8  34/18888 8.746969e-05 0.01533276 0.006745377
## GO:0070670       2/8  37/18888 1.037750e-04 0.01533276 0.006745377
## GO:0033120       2/8  50/18888 1.903523e-04 0.01886635 0.008299917
## GO:0048009       2/8  53/18888 2.139908e-04 0.01886635 0.008299917
##                       geneID Count
## GO:0031099 CCND1/IGF1R/SRSF1     3
## GO:0097421       CCND1/SRSF1     2
## GO:0071353       TUBA1B/FASN     2
## GO:0070670       TUBA1B/FASN     2
## GO:0033120      PIK3R1/SRSF1     2
## GO:0048009      PIK3R1/IGF1R     2
##                    ID
## GO:0061695 GO:0061695
## GO:0097128 GO:0097128
## GO:1902911 GO:1902911
## GO:0005899 GO:0005899
## GO:0035867 GO:0035867
## GO:1990578 GO:1990578
##                                                               Description
## GO:0061695 transferase complex, transferring phosphorus-containing groups
## GO:0097128                                         cyclin D1-CDK4 complex
## GO:1902911                                         protein kinase complex
## GO:0005899                                       insulin receptor complex
## GO:0035867                      alphav-beta3 integrin-IGF-1-IGF1R complex
## GO:1990578                     perinuclear endoplasmic reticulum membrane
##            GeneRatio   BgRatio       pvalue    p.adjust      qvalue
## GO:0061695       3/8 308/19894 0.0001942755 0.008353845 0.003681009
## GO:0097128       1/8   2/19894 0.0008041211 0.011521680 0.005076873
## GO:1902911       2/8 150/19894 0.0015348825 0.011521680 0.005076873
## GO:0005899       1/8   4/19894 0.0016076763 0.011521680 0.005076873
## GO:0035867       1/8   4/19894 0.0016076763 0.011521680 0.005076873
## GO:1990578       1/8   4/19894 0.0016076763 0.011521680 0.005076873
##                        geneID Count
## GO:0061695 CCND1/PIK3R1/IGF1R     3
## GO:0097128              CCND1     1
## GO:1902911        CCND1/IGF1R     2
## GO:0005899              IGF1R     1
## GO:0035867              IGF1R     1
## GO:1990578             PIK3R1     1
##                    ID
## GO:0004345 GO:0004345
## GO:0005536 GO:0005536
## GO:0050661 GO:0050661
## GO:0048029 GO:0048029
## GO:0016616 GO:0016616
## GO:0016614 GO:0016614
##                                                                                      Description
## GO:0004345                                            glucose-6-phosphate dehydrogenase activity
## GO:0005536                                                                       glucose binding
## GO:0050661                                                                          NADP binding
## GO:0048029                                                                monosaccharide binding
## GO:0016616 oxidoreductase activity, acting on the CH-OH group of donors, NAD or NADP as acceptor
## GO:0016614                              oxidoreductase activity, acting on CH-OH group of donors
##            GeneRatio   BgRatio       pvalue     p.adjust qvalue geneID Count
## GO:0004345       1/1   2/18522 0.0001079797 0.0007558579     NA   G6PD     1
## GO:0005536       1/1  11/18522 0.0005938883 0.0020786092     NA   G6PD     1
## GO:0050661       1/1  53/18522 0.0028614620 0.0066767448     NA   G6PD     1
## GO:0048029       1/1  74/18522 0.0039952489 0.0069916856     NA   G6PD     1
## GO:0016616       1/1 125/18522 0.0067487312 0.0085034014     NA   G6PD     1
## GO:0016614       1/1 135/18522 0.0072886297 0.0085034014     NA   G6PD     1
##                    ID
## GO:0010731 GO:0010731
## GO:0010732 GO:0010732
## GO:0010734 GO:0010734
## GO:0019322 GO:0019322
## GO:1904879 GO:1904879
## GO:0009051 GO:0009051
##                                                                                                  Description
## GO:0010731                                                                         protein glutathionylation
## GO:0010732                                                           regulation of protein glutathionylation
## GO:0010734                                                  negative regulation of protein glutathionylation
## GO:0019322                                                                      pentose biosynthetic process
## GO:1904879 positive regulation of calcium ion transmembrane transport via high voltage-gated calcium channel
## GO:0009051                                                         pentose-phosphate shunt, oxidative branch
##            GeneRatio BgRatio       pvalue    p.adjust qvalue geneID Count
## GO:0010731       1/1 2/18888 0.0001058873 0.003388395     NA   G6PD     1
## GO:0010732       1/1 2/18888 0.0001058873 0.003388395     NA   G6PD     1
## GO:0010734       1/1 2/18888 0.0001058873 0.003388395     NA   G6PD     1
## GO:0019322       1/1 2/18888 0.0001058873 0.003388395     NA   G6PD     1
## GO:1904879       1/1 3/18888 0.0001588310 0.003872451     NA   G6PD     1
## GO:0009051       1/1 4/18888 0.0002117747 0.003872451     NA   G6PD     1
##                    ID                         Description GeneRatio   BgRatio
## GO:0034451 GO:0034451                centriolar satellite       1/1 126/19894
## GO:0009898 GO:0009898 cytoplasmic side of plasma membrane       1/1 161/19894
## GO:0098562 GO:0098562        cytoplasmic side of membrane       1/1 199/19894
##                 pvalue   p.adjust qvalue geneID Count
## GO:0034451 0.006333568 0.01000302     NA   G6PD     1
## GO:0009898 0.008092892 0.01000302     NA   G6PD     1
## GO:0098562 0.010003016 0.01000302     NA   G6PD     1
##                    ID                                Description GeneRatio
## GO:0030544 GO:0030544                      Hsp70 protein binding      3/15
## GO:0031072 GO:0031072                 heat shock protein binding      3/15
## GO:0035173 GO:0035173                    histone kinase activity      2/15
## GO:0051087 GO:0051087          protein-folding chaperone binding      3/15
## GO:0004345 GO:0004345 glucose-6-phosphate dehydrogenase activity      1/15
## GO:0004998 GO:0004998              transferrin receptor activity      1/15
##              BgRatio       pvalue     p.adjust       qvalue         geneID
## GO:0030544  51/18522 8.742153e-06 0.0008042781 0.0002944725 TSC1/CDK1/TFRC
## GO:0031072 130/18522 1.445214e-04 0.0035561457 0.0013020213 TSC1/CDK1/TFRC
## GO:0035173  23/18522 1.533626e-04 0.0035561457 0.0013020213       ATM/CDK1
## GO:0051087 133/18522 1.546150e-04 0.0035561457 0.0013020213 TSC1/CDK1/TFRC
## GO:0004345   2/18522 1.619083e-03 0.0155992780 0.0057114061           G6PD
## GO:0004998   2/18522 1.619083e-03 0.0155992780 0.0057114061           TFRC
##            Count
## GO:0030544     3
## GO:0031072     3
## GO:0035173     2
## GO:0051087     3
## GO:0004345     1
## GO:0004998     1
##                    ID                            Description GeneRatio
## GO:0045785 GO:0045785   positive regulation of cell adhesion      7/15
## GO:0036293 GO:0036293    response to decreased oxygen levels      5/15
## GO:0070482 GO:0070482              response to oxygen levels      5/15
## GO:1904262 GO:1904262 negative regulation of TORC1 signaling      3/15
## GO:0031929 GO:0031929                          TOR signaling      4/15
## GO:0002520 GO:0002520              immune system development      4/15
##              BgRatio       pvalue     p.adjust       qvalue
## GO:0045785 485/18888 3.795691e-08 4.957173e-05 2.305383e-05
## GO:0036293 327/18888 3.928245e-06 1.857270e-03 8.637421e-04
## GO:0070482 354/18888 5.784493e-06 1.857270e-03 8.637421e-04
## GO:1904262  47/18888 6.433980e-06 1.857270e-03 8.637421e-04
## GO:0031929 165/18888 7.110528e-06 1.857270e-03 8.637421e-04
## GO:0002520 197/18888 1.431938e-05 2.835323e-03 1.318595e-03
##                                           geneID Count
## GO:0045785 IGFBP2/GATA3/ATM/TSC1/XBP1/TFRC/PREX1     7
## GO:0036293              ATM/ACVRL1/TSC1/VHL/TFRC     5
## GO:0070482              ATM/ACVRL1/TSC1/VHL/TFRC     5
## GO:1904262                          ATM/TSC1/VHL     3
## GO:0031929                    GATA3/ATM/TSC1/VHL     4
## GO:0002520                  RBM15/GATA3/ATM/TFRC     4
##                    ID            Description GeneRatio   BgRatio      pvalue
## GO:0097122 GO:0097122 cyclin A2-CDK1 complex      1/15   2/19894 0.001507462
## GO:0097125 GO:0097125 cyclin B1-CDK1 complex      1/15   2/19894 0.001507462
## GO:0033596 GO:0033596      TSC1-TSC2 complex      1/15   4/19894 0.003012802
## GO:0070724 GO:0070724   BMP receptor complex      1/15   4/19894 0.003012802
## GO:0042470 GO:0042470             melanosome      2/15 112/19894 0.003144193
## GO:0048770 GO:0048770        pigment granule      2/15 112/19894 0.003144193
##              p.adjust     qvalue     geneID Count
## GO:0097122 0.03825434 0.02978709       CDK1     1
## GO:0097125 0.03825434 0.02978709       CDK1     1
## GO:0033596 0.03825434 0.02978709       TSC1     1
## GO:0070724 0.03825434 0.02978709     ACVRL1     1
## GO:0042470 0.03825434 0.02978709 PRDX1/TFRC     2
## GO:0048770 0.03825434 0.02978709 PRDX1/TFRC     2
##                    ID
## GO:0004365 GO:0004365
## GO:0043891 GO:0043891
## GO:0005006 GO:0005006
## GO:0048408 GO:0048408
## GO:0030235 GO:0030235
## GO:0019828 GO:0019828
##                                                                              Description
## GO:0004365    glyceraldehyde-3-phosphate dehydrogenase (NAD+) (phosphorylating) activity
## GO:0043891 glyceraldehyde-3-phosphate dehydrogenase (NAD(P)+) (phosphorylating) activity
## GO:0005006                                     epidermal growth factor receptor activity
## GO:0048408                                               epidermal growth factor binding
## GO:0030235                                      nitric-oxide synthase regulator activity
## GO:0019828                                aspartic-type endopeptidase inhibitor activity
##            GeneRatio BgRatio       pvalue    p.adjust      qvalue geneID Count
## GO:0004365       1/3 2/18522 0.0003239216 0.007125506 0.001022800  GAPDH     1
## GO:0043891       1/3 2/18522 0.0003239216 0.007125506 0.001022800  GAPDH     1
## GO:0005006       1/3 3/18522 0.0004858562 0.007125506 0.001022800   EGFR     1
## GO:0048408       1/3 4/18522 0.0006477733 0.007125506 0.001022800   EGFR     1
## GO:0030235       1/3 7/18522 0.0011334196 0.009498623 0.001363439   EGFR     1
## GO:0019828       1/3 8/18522 0.0012952667 0.009498623 0.001363439  GAPDH     1
##                    ID
## GO:0001890 GO:0001890
## GO:0035606 GO:0035606
## GO:1902722 GO:1902722
## GO:0033590 GO:0033590
## GO:0033594 GO:0033594
## GO:0010750 GO:0010750
##                                                                 Description
## GO:0001890                                             placenta development
## GO:0035606                          peptidyl-cysteine S-trans-nitrosylation
## GO:1902722                       positive regulation of prolactin secretion
## GO:0033590                                            response to cobalamin
## GO:0033594                                    response to hydroxyisoflavone
## GO:0010750 positive regulation of nitric oxide mediated signal transduction
##            GeneRatio   BgRatio       pvalue  p.adjust      qvalue     geneID
## GO:0001890       2/3 150/18888 0.0001869713 0.0292701 0.005275792 RBM15/EGFR
## GO:0035606       1/3   2/18888 0.0003176452 0.0292701 0.005275792      GAPDH
## GO:1902722       1/3   2/18888 0.0003176452 0.0292701 0.005275792       EGFR
## GO:0033590       1/3   4/18888 0.0006352231 0.0292701 0.005275792       EGFR
## GO:0033594       1/3   4/18888 0.0006352231 0.0292701 0.005275792       EGFR
## GO:0010750       1/3   5/18888 0.0007939868 0.0292701 0.005275792       EGFR
##            Count
## GO:0001890     2
## GO:0035606     1
## GO:1902722     1
## GO:0033590     1
## GO:0033594     1
## GO:0010750     1
##                    ID                                      Description
## GO:0031965 GO:0031965                                 nuclear membrane
## GO:0005635 GO:0005635                                 nuclear envelope
## GO:0070435 GO:0070435                                 Shc-EGFR complex
## GO:0097452 GO:0097452                                     GAIT complex
## GO:0097487 GO:0097487            multivesicular body, internal vesicle
## GO:0036396 GO:0036396 RNA N6-methyladenosine methyltransferase complex
##            GeneRatio   BgRatio       pvalue     p.adjust       qvalue
## GO:0031965       3/3 313/19894 3.857967e-06 0.0001427448 3.654916e-05
## GO:0005635       3/3 498/19894 1.559432e-05 0.0002884950 7.386785e-05
## GO:0070435       1/3   2/19894 3.015833e-04 0.0037195275 9.523684e-04
## GO:0097452       1/3   4/19894 6.031060e-04 0.0055787303 1.428409e-03
## GO:0097487       1/3   6/19894 9.045680e-04 0.0066938033 1.713918e-03
## GO:0036396       1/3   9/19894 1.356647e-03 0.0083659922 2.142075e-03
##                      geneID Count
## GO:0031965 RBM15/EGFR/GAPDH     3
## GO:0005635 RBM15/EGFR/GAPDH     3
## GO:0070435             EGFR     1
## GO:0097452            GAPDH     1
## GO:0097487             EGFR     1
## GO:0036396            RBM15     1
##                    ID
## GO:0005113 GO:0005113
## GO:0008353 GO:0008353
## GO:0061575 GO:0061575
## GO:0035173 GO:0035173
## GO:0140994 GO:0140994
## GO:0004693 GO:0004693
##                                                                    Description
## GO:0005113                                                     patched binding
## GO:0008353           RNA polymerase II CTD heptapeptide repeat kinase activity
## GO:0061575 cyclin-dependent protein serine/threonine kinase activator activity
## GO:0035173                                             histone kinase activity
## GO:0140994        RNA polymerase II CTD heptapeptide repeat modifying activity
## GO:0004693           cyclin-dependent protein serine/threonine kinase activity
##            GeneRatio  BgRatio      pvalue  p.adjust     qvalue geneID Count
## GO:0005113       1/5  8/18522 0.002157962 0.0289896 0.01056301  CCNB1     1
## GO:0008353       1/5 10/18522 0.002696870 0.0289896 0.01056301   CDK1     1
## GO:0061575       1/5 16/18522 0.004312197 0.0289896 0.01056301  CCNB1     1
## GO:0035173       1/5 23/18522 0.006194099 0.0289896 0.01056301   CDK1     1
## GO:0140994       1/5 23/18522 0.006194099 0.0289896 0.01056301   CDK1     1
## GO:0004693       1/5 29/18522 0.007804892 0.0289896 0.01056301   CDK1     1
##                    ID
## GO:1905448 GO:1905448
## GO:1905446 GO:1905446
## GO:0044772 GO:0044772
## GO:0000086 GO:0000086
## GO:0044839 GO:0044839
## GO:1902850 GO:1902850
##                                                                              Description
## GO:1905448 positive regulation of mitochondrial ATP synthesis coupled electron transport
## GO:1905446          regulation of mitochondrial ATP synthesis coupled electron transport
## GO:0044772                                           mitotic cell cycle phase transition
## GO:0000086                                         G2/M transition of mitotic cell cycle
## GO:0044839                                              cell cycle G2/M phase transition
## GO:1902850                     microtubule cytoskeleton organization involved in mitosis
##            GeneRatio   BgRatio       pvalue     p.adjust       qvalue
## GO:1905448       2/5   4/18888 3.363104e-07 0.0001069467 2.584280e-05
## GO:1905446       2/5   7/18888 1.176712e-06 0.0001668324 4.031369e-05
## GO:0044772       4/5 451/18888 1.573891e-06 0.0001668324 4.031369e-05
## GO:0000086       3/5 136/18888 3.613177e-06 0.0002872476 6.941103e-05
## GO:0044839       3/5 152/18888 5.049737e-06 0.0003211632 7.760648e-05
## GO:1902850       3/5 164/18888 6.345810e-06 0.0003363279 8.127090e-05
##                           geneID Count
## GO:1905448            CDK1/CCNB1     2
## GO:1905446            CDK1/CCNB1     2
## GO:0044772 ANLN/CDK1/CCNB1/FOXM1     4
## GO:0000086      CDK1/CCNB1/FOXM1     3
## GO:0044839      CDK1/CCNB1/FOXM1     3
## GO:1902850      STMN1/CDK1/CCNB1     3
##                    ID                                        Description
## GO:0097125 GO:0097125                             cyclin B1-CDK1 complex
## GO:0000307 GO:0000307 cyclin-dependent protein kinase holoenzyme complex
## GO:1902554 GO:1902554            serine/threonine protein kinase complex
## GO:0097122 GO:0097122                             cyclin A2-CDK1 complex
## GO:1902911 GO:1902911                             protein kinase complex
## GO:0005826 GO:0005826                        actomyosin contractile ring
##            GeneRatio   BgRatio       pvalue     p.adjust       qvalue
## GO:0097125       2/5   2/19894 5.053678e-08 1.364493e-06 1.595898e-07
## GO:0000307       2/5  56/19894 7.740495e-05 1.044967e-03 1.222183e-04
## GO:1902554       2/5 136/19894 4.577086e-04 3.004513e-03 3.514051e-04
## GO:0097122       1/5   2/19894 5.026136e-04 3.004513e-03 3.514051e-04
## GO:1902911       2/5 150/19894 5.563914e-04 3.004513e-03 3.514051e-04
## GO:0005826       1/5   4/19894 1.005025e-03 3.993377e-03 4.670617e-04
##                geneID Count
## GO:0097125 CDK1/CCNB1     2
## GO:0000307 CDK1/CCNB1     2
## GO:1902554 CDK1/CCNB1     2
## GO:0097122       CDK1     1
## GO:1902911 CDK1/CCNB1     2
## GO:0005826       ANLN     1
barplot(ego_MF[[1]], title = "enrichGO, Molecular Function, bicluster 1")

barplot(ego_MF[[2]], title = "enrichGO, Molecular Function, bicluster 2")

barplot(ego_MF[[3]], title = "enrichGO, Molecular Function, bicluster 3")

barplot(ego_MF[[4]], title = "enrichGO, Molecular Function, bicluster 4")

barplot(ego_MF[[5]], title = "enrichGO, Molecular Function, bicluster 6")

barplot(ego_MF[[6]], title = "enrichGO, Molecular Function, bicluster 7")

barplot(ego_MF[[7]], title = "enrichGO, Molecular Function, bicluster 8")

barplot(ego_MF[[8]], title = "enrichGO, Molecular Function, bicluster 9")

barplot(ego_BP[[1]], title = "enrichGO, Biological Process, bicluster 1")

barplot(ego_BP[[2]], title = "enrichGO, Biological Process, bicluster 2")

barplot(ego_BP[[3]], title = "enrichGO, Biological Process, bicluster 3")

barplot(ego_BP[[4]], title = "enrichGO, Biological Process, bicluster 4")

barplot(ego_BP[[5]], title = "enrichGO, Biological Process, bicluster 6")

barplot(ego_BP[[6]], title = "enrichGO, Biological Process, bicluster 7")

barplot(ego_BP[[7]], title = "enrichGO, Biological Process, bicluster 8")

barplot(ego_BP[[8]], title = "enrichGO, Biological Process, bicluster 9")

barplot(ego_CC[[1]], title = "enrichGO, Cellular Component, bicluster 1")

barplot(ego_CC[[2]], title = "enrichGO, Cellular Component, bicluster 2")

barplot(ego_CC[[3]], title = "enrichGO, Cellular Component, bicluster 3")

barplot(ego_CC[[4]], title = "enrichGO, Cellular Component, bicluster 4")

barplot(ego_CC[[5]], title = "enrichGO, Cellular Component, bicluster 6")

barplot(ego_CC[[6]], title = "enrichGO, Cellular Component, bicluster 7")

barplot(ego_CC[[7]], title = "enrichGO, Cellular Component, bicluster 8")

barplot(ego_CC[[8]], title = "enrichGO, Cellular Component, bicluster 9")

DAG plots for ego

goplot(ego_MF[[1]]) + labs(title = "enrichGO, Molecular Function, bicluster 1")

goplot(ego_MF[[2]]) + labs(title = "enrichGO, Molecular Function, bicluster 2")

goplot(ego_MF[[3]]) + labs(title = "enrichGO, Molecular Function, bicluster 3")

goplot(ego_MF[[4]]) + labs(title = "enrichGO, Molecular Function, bicluster 4")

goplot(ego_MF[[5]]) + labs(title = "enrichGO, Molecular Function, bicluster 6")

goplot(ego_MF[[6]]) + labs(title = "enrichGO, Molecular Function, bicluster 7")

goplot(ego_MF[[7]]) + labs(title = "enrichGO, Molecular Function, bicluster 8")

goplot(ego_MF[[8]]) + labs(title = "enrichGO, Molecular Function, bicluster 9")

goplot(ego_BP[[1]]) + labs(title = "enrichGO, Biological Process, bicluster 1")

goplot(ego_BP[[2]]) + labs(title = "enrichGO, Biological Process, bicluster 2")

goplot(ego_BP[[3]]) + labs(title = "enrichGO, Biological Process, bicluster 3")
## Warning: ggrepel: 26 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

goplot(ego_BP[[4]]) + labs(title = "enrichGO, Biological Process, bicluster 4")
## Warning: ggrepel: 4 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

goplot(ego_BP[[5]]) + labs(title = "enrichGO, Biological Process, bicluster 6")
## Warning: ggrepel: 65 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

goplot(ego_BP[[6]]) + labs(title = "enrichGO, Biological Process, bicluster 7")

goplot(ego_BP[[7]]) + labs(title = "enrichGO, Biological Process, bicluster 8")
## Warning: ggrepel: 46 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps

goplot(ego_BP[[8]]) + labs(title = "enrichGO, Biological Process, bicluster 9")

goplot(ego_CC[[1]]) + labs(title = "enrichGO, Cellular Component, bicluster 1")

goplot(ego_CC[[2]]) + labs(title = "enrichGO, Cellular Component, bicluster 2")

goplot(ego_CC[[3]]) + labs(title = "enrichGO, Cellular Component, bicluster 3")

goplot(ego_CC[[4]]) + labs(title = "enrichGO, Cellular Component, bicluster 4")

goplot(ego_CC[[5]]) + labs(title = "enrichGO, Cellular Component, bicluster 6")

goplot(ego_CC[[6]]) + labs(title = "enrichGO, Cellular Component, bicluster 7")

goplot(ego_CC[[7]]) + labs(title = "enrichGO, Cellular Component, bicluster 8")

goplot(ego_CC[[8]]) + labs(title = "enrichGO, Cellular Component, bicluster 9")

3. Export Pathway Analysis result to data

pathway = list("ggo_MF" = ggo_MF,
               "ggo_BP" = ggo_BP,
               "ggo_CC" = ggo_CC,
               "ego_MF" = ego_MF,
               "ego_BP" = ego_BP,
               "ego_CC" = ego_CC)

saveRDS(pathway, file = "data/out_pathway/pathways_superbiclust.fabia_mofa.rds")